// 相当于vue中main.js
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import axios from 'axios'
import store from './store'
import {Provider} from 'react-redux'
import reportWebVitals from './reportWebVitals';
// BrowserRouter对应history模式；HashRouter对应hash模式
import {BrowserRouter} from 'react-router-dom'
Component.prototype.http = axios;
ReactDOM.render(
  <BrowserRouter>
  {/* Provider是数据的提供者，提供store这个数据给子组件，这里是父传子，可以在任意一级子组件收到store的数据 */}
    <Provider store={store}>
      <App />
    </Provider>
  </BrowserRouter>,
  document.getElementById('root')
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
